import React, { Component } from 'react';
import { Swiper } from 'antd-mobile'
import PropTypes from 'prop-types'
class Index extends Component {
	static defaultProps = {
		height: 200
	}
	render() {
		const { banners, height } = this.props
		return (
			<Swiper>
				{
					banners.length && banners.map((v, i) => {
						return <Swiper.Item key={ i }>
							<img src={ v } height={ height }></img>
						</Swiper.Item>
					})
				}
			</Swiper>
		);
	}
}


Index.propTypes = {
	banners: PropTypes.array.isRequired,
	height: PropTypes.number
}
export default Index;
